import React, { Component } from 'react'
import { connect } from 'react-redux'
import * as actions from "../../store/action"
import { bindActionCreators } from 'redux'
import TabTitle from "../../components/TabTitle"
import TabCont from '../../components/TabCont'
export class Fenxi extends Component {
  componentDidMount() { 
    this.props.getListAction()
   }
  render() {
    console.log(this.props,"shu")
    const {list ,activeIndex} =this.props
    return (
      <div>
        <TabTitle></TabTitle>
        <TabCont
         children={list[activeIndex] ? 
         list[activeIndex].children :[]  }>

        </TabCont>


      </div>
    )
  }
}

const mapStateToProps = (state) => ({
  ...state.reducer
})

const mapDispatchToProps =(dispatch)=>{
  return bindActionCreators(actions,dispatch)
}

export default connect(mapStateToProps, mapDispatchToProps)(Fenxi)